3.386 \(\int x^2 (d+e x^r)^2 (a+b \log (c x^n)) \, dx\)

Optimal. Leaf size=105 \[ \frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{r+3}}{r+3}+\frac{3 e^2 x^{2 r+3}}{2 r+3}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{9} b d^2 n x^3-\frac{2 b d e n x^{r+3}}{(r+3)^2}-\frac{b e^2 n x^{2 r+3}}{(2 r+3)^2} \]

[Out]

-(b*d^2*n*x^3)/9 - (2*b*d*e*n*x^(3 + r))/(3 + r)^2 - (b*e^2*n*x^(3 + 2*r))/(3 + 2*r)^2 + ((d^2*x^3 + (6*d*e*x^
(3 + r))/(3 + r) + (3*e^2*x^(3 + 2*r))/(3 + 2*r))*(a + b*Log[c*x^n]))/3

________________________________________________________________________________________

Rubi [A]  time = 0.15994, antiderivative size = 105, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {270, 2334, 12, 14} \[ \frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{r+3}}{r+3}+\frac{3 e^2 x^{2 r+3}}{2 r+3}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{9} b d^2 n x^3-\frac{2 b d e n x^{r+3}}{(r+3)^2}-\frac{b e^2 n x^{2 r+3}}{(2 r+3)^2} \]

Antiderivative was successfully verified.

[In]

Int[x^2*(d + e*x^r)^2*(a + b*Log[c*x^n]),x]

[Out]

-(b*d^2*n*x^3)/9 - (2*b*d*e*n*x^(3 + r))/(3 + r)^2 - (b*e^2*n*x^(3 + 2*r))/(3 + 2*r)^2 + ((d^2*x^3 + (6*d*e*x^
(3 + r))/(3 + r) + (3*e^2*x^(3 + 2*r))/(3 + 2*r))*(a + b*Log[c*x^n]))/3

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int x^2 \left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right ) \, dx &=\frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{3+r}}{3+r}+\frac{3 e^2 x^{3+2 r}}{3+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{1}{3} x^2 \left (d^2+\frac{6 d e x^r}{3+r}+\frac{3 e^2 x^{2 r}}{3+2 r}\right ) \, dx\\ &=\frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{3+r}}{3+r}+\frac{3 e^2 x^{3+2 r}}{3+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int x^2 \left (d^2+\frac{6 d e x^r}{3+r}+\frac{3 e^2 x^{2 r}}{3+2 r}\right ) \, dx\\ &=\frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{3+r}}{3+r}+\frac{3 e^2 x^{3+2 r}}{3+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int \left (d^2 x^2+\frac{3 e^2 x^{2 (1+r)}}{3+2 r}+\frac{6 d e x^{2+r}}{3+r}\right ) \, dx\\ &=-\frac{1}{9} b d^2 n x^3-\frac{2 b d e n x^{3+r}}{(3+r)^2}-\frac{b e^2 n x^{3+2 r}}{(3+2 r)^2}+\frac{1}{3} \left (d^2 x^3+\frac{6 d e x^{3+r}}{3+r}+\frac{3 e^2 x^{3+2 r}}{3+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.254736, size = 124, normalized size = 1.18 \[ \frac{1}{9} x^3 \left (3 a \left (d^2+\frac{6 d e x^r}{r+3}+\frac{3 e^2 x^{2 r}}{2 r+3}\right )+3 b \log \left (c x^n\right ) \left (d^2+\frac{6 d e x^r}{r+3}+\frac{3 e^2 x^{2 r}}{2 r+3}\right )+b n \left (-d^2-\frac{18 d e x^r}{(r+3)^2}-\frac{9 e^2 x^{2 r}}{(2 r+3)^2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*(d + e*x^r)^2*(a + b*Log[c*x^n]),x]

[Out]

(x^3*(b*n*(-d^2 - (18*d*e*x^r)/(3 + r)^2 - (9*e^2*x^(2*r))/(3 + 2*r)^2) + 3*a*(d^2 + (6*d*e*x^r)/(3 + r) + (3*
e^2*x^(2*r))/(3 + 2*r)) + 3*b*(d^2 + (6*d*e*x^r)/(3 + r) + (3*e^2*x^(2*r))/(3 + 2*r))*Log[c*x^n]))/9

________________________________________________________________________________________

Maple [C]  time = 0.293, size = 1930, normalized size = 18.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(d+e*x^r)^2*(a+b*ln(c*x^n)),x)

[Out]

1/3*b*x^3*(3*e^2*(x^r)^2*r+2*d^2*r^2+12*d*e*x^r*r+9*e^2*(x^r)^2+9*d^2*r+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243*I*Pi*b*e^2*csgn(I*c*x^n)^3*(x^r)^2-243*I*Pi*b*d^2*csgn(I*x^n)*
csgn(I*c*x^n)^2+108*I*Pi*b*d^2*r^3*csgn(I*c*x^n)^3+486*I*Pi*b*d*e*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r+324*
I*Pi*b*e^2*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*(x^r)^2-351*I*Pi*b*d^2*r^2*csgn(I*x^n)*csgn(I*c*x^n)^2-432*I*
Pi*b*d*e*r^2*csgn(I*c*x^n)^2*csgn(I*c)*x^r-108*I*Pi*b*d^2*r^3*csgn(I*c*x^n)^2*csgn(I*c)+324*I*Pi*b*e^2*r*csgn(
I*c*x^n)^3*(x^r)^2-243*I*Pi*b*e^2*csgn(I*c*x^n)^2*csgn(I*c)*(x^r)^2-72*I*Pi*b*d*e*r^3*csgn(I*x^n)*csgn(I*c*x^n
)^2*x^r-864*ln(c)*b*d*e*r^2*x^r-1620*ln(c)*b*d*e*r*x^r-144*ln(c)*b*d*e*r^3*x^r+351*I*Pi*b*d^2*r^2*csgn(I*c*x^n
)^3+135*I*Pi*b*e^2*r^2*csgn(I*c*x^n)^3*(x^r)^2+432*I*Pi*b*d*e*r^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r-810*
I*Pi*b*d*e*r*csgn(I*x^n)*csgn(I*c*x^n)^2*x^r+432*b*d*e*n*r*x^r+144*b*d*e*n*r^2*x^r+243*I*Pi*b*d^2*csgn(I*x^n)*
csgn(I*c*x^n)*csgn(I*c)-12*I*Pi*b*d^2*r^4*csgn(I*x^n)*csgn(I*c*x^n)^2-12*I*Pi*b*d^2*r^4*csgn(I*c*x^n)^2*csgn(I
*c)-810*I*Pi*b*d*e*r*csgn(I*c*x^n)^2*csgn(I*c)*x^r-351*I*Pi*b*d^2*r^2*csgn(I*c*x^n)^2*csgn(I*c))/(3+2*r)^2/(3+
r)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.37507, size = 1172, normalized size = 11.16 \begin{align*} \frac{3 \,{\left (4 \, b d^{2} r^{4} + 36 \, b d^{2} r^{3} + 117 \, b d^{2} r^{2} + 162 \, b d^{2} r + 81 \, b d^{2}\right )} x^{3} \log \left (c\right ) + 3 \,{\left (4 \, b d^{2} n r^{4} + 36 \, b d^{2} n r^{3} + 117 \, b d^{2} n r^{2} + 162 \, b d^{2} n r + 81 \, b d^{2} n\right )} x^{3} \log \left (x\right ) -{\left (4 \,{\left (b d^{2} n - 3 \, a d^{2}\right )} r^{4} + 81 \, b d^{2} n + 36 \,{\left (b d^{2} n - 3 \, a d^{2}\right )} r^{3} - 243 \, a d^{2} + 117 \,{\left (b d^{2} n - 3 \, a d^{2}\right )} r^{2} + 162 \,{\left (b d^{2} n - 3 \, a d^{2}\right )} r\right )} x^{3} + 9 \,{\left ({\left (2 \, b e^{2} r^{3} + 15 \, b e^{2} r^{2} + 36 \, b e^{2} r + 27 \, b e^{2}\right )} x^{3} \log \left (c\right ) +{\left (2 \, b e^{2} n r^{3} + 15 \, b e^{2} n r^{2} + 36 \, b e^{2} n r + 27 \, b e^{2} n\right )} x^{3} \log \left (x\right ) +{\left (2 \, a e^{2} r^{3} - 9 \, b e^{2} n + 27 \, a e^{2} -{\left (b e^{2} n - 15 \, a e^{2}\right )} r^{2} - 6 \,{\left (b e^{2} n - 6 \, a e^{2}\right )} r\right )} x^{3}\right )} x^{2 \, r} + 18 \,{\left ({\left (4 \, b d e r^{3} + 24 \, b d e r^{2} + 45 \, b d e r + 27 \, b d e\right )} x^{3} \log \left (c\right ) +{\left (4 \, b d e n r^{3} + 24 \, b d e n r^{2} + 45 \, b d e n r + 27 \, b d e n\right )} x^{3} \log \left (x\right ) +{\left (4 \, a d e r^{3} - 9 \, b d e n + 27 \, a d e - 4 \,{\left (b d e n - 6 \, a d e\right )} r^{2} - 3 \,{\left (4 \, b d e n - 15 \, a d e\right )} r\right )} x^{3}\right )} x^{r}}{9 \,{\left (4 \, r^{4} + 36 \, r^{3} + 117 \, r^{2} + 162 \, r + 81\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="fricas")

[Out]

1/9*(3*(4*b*d^2*r^4 + 36*b*d^2*r^3 + 117*b*d^2*r^2 + 162*b*d^2*r + 81*b*d^2)*x^3*log(c) + 3*(4*b*d^2*n*r^4 + 3
6*b*d^2*n*r^3 + 117*b*d^2*n*r^2 + 162*b*d^2*n*r + 81*b*d^2*n)*x^3*log(x) - (4*(b*d^2*n - 3*a*d^2)*r^4 + 81*b*d
^2*n + 36*(b*d^2*n - 3*a*d^2)*r^3 - 243*a*d^2 + 117*(b*d^2*n - 3*a*d^2)*r^2 + 162*(b*d^2*n - 3*a*d^2)*r)*x^3 +
 9*((2*b*e^2*r^3 + 15*b*e^2*r^2 + 36*b*e^2*r + 27*b*e^2)*x^3*log(c) + (2*b*e^2*n*r^3 + 15*b*e^2*n*r^2 + 36*b*e
^2*n*r + 27*b*e^2*n)*x^3*log(x) + (2*a*e^2*r^3 - 9*b*e^2*n + 27*a*e^2 - (b*e^2*n - 15*a*e^2)*r^2 - 6*(b*e^2*n
- 6*a*e^2)*r)*x^3)*x^(2*r) + 18*((4*b*d*e*r^3 + 24*b*d*e*r^2 + 45*b*d*e*r + 27*b*d*e)*x^3*log(c) + (4*b*d*e*n*
r^3 + 24*b*d*e*n*r^2 + 45*b*d*e*n*r + 27*b*d*e*n)*x^3*log(x) + (4*a*d*e*r^3 - 9*b*d*e*n + 27*a*d*e - 4*(b*d*e*
n - 6*a*d*e)*r^2 - 3*(4*b*d*e*n - 15*a*d*e)*r)*x^3)*x^r)/(4*r^4 + 36*r^3 + 117*r^2 + 162*r + 81)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(d+e*x**r)**2*(a+b*ln(c*x**n)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.2503, size = 1007, normalized size = 9.59 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="giac")

[Out]

1/9*(12*b*d^2*n*r^4*x^3*log(x) + 72*b*d*n*r^3*x^3*x^r*e*log(x) - 4*b*d^2*n*r^4*x^3 + 12*b*d^2*r^4*x^3*log(c) +
 72*b*d*r^3*x^3*x^r*e*log(c) + 108*b*d^2*n*r^3*x^3*log(x) + 18*b*n*r^3*x^3*x^(2*r)*e^2*log(x) + 432*b*d*n*r^2*
x^3*x^r*e*log(x) - 36*b*d^2*n*r^3*x^3 + 12*a*d^2*r^4*x^3 - 72*b*d*n*r^2*x^3*x^r*e + 72*a*d*r^3*x^3*x^r*e + 108
*b*d^2*r^3*x^3*log(c) + 18*b*r^3*x^3*x^(2*r)*e^2*log(c) + 432*b*d*r^2*x^3*x^r*e*log(c) + 351*b*d^2*n*r^2*x^3*l
og(x) + 135*b*n*r^2*x^3*x^(2*r)*e^2*log(x) + 810*b*d*n*r*x^3*x^r*e*log(x) - 117*b*d^2*n*r^2*x^3 + 108*a*d^2*r^
3*x^3 - 9*b*n*r^2*x^3*x^(2*r)*e^2 + 18*a*r^3*x^3*x^(2*r)*e^2 - 216*b*d*n*r*x^3*x^r*e + 432*a*d*r^2*x^3*x^r*e +
 351*b*d^2*r^2*x^3*log(c) + 135*b*r^2*x^3*x^(2*r)*e^2*log(c) + 810*b*d*r*x^3*x^r*e*log(c) + 486*b*d^2*n*r*x^3*
log(x) + 324*b*n*r*x^3*x^(2*r)*e^2*log(x) + 486*b*d*n*x^3*x^r*e*log(x) - 162*b*d^2*n*r*x^3 + 351*a*d^2*r^2*x^3
 - 54*b*n*r*x^3*x^(2*r)*e^2 + 135*a*r^2*x^3*x^(2*r)*e^2 - 162*b*d*n*x^3*x^r*e + 810*a*d*r*x^3*x^r*e + 486*b*d^
2*r*x^3*log(c) + 324*b*r*x^3*x^(2*r)*e^2*log(c) + 486*b*d*x^3*x^r*e*log(c) + 243*b*d^2*n*x^3*log(x) + 243*b*n*
x^3*x^(2*r)*e^2*log(x) - 81*b*d^2*n*x^3 + 486*a*d^2*r*x^3 - 81*b*n*x^3*x^(2*r)*e^2 + 324*a*r*x^3*x^(2*r)*e^2 +
 486*a*d*x^3*x^r*e + 243*b*d^2*x^3*log(c) + 243*b*x^3*x^(2*r)*e^2*log(c) + 243*a*d^2*x^3 + 243*a*x^3*x^(2*r)*e
^2)/(4*r^4 + 36*r^3 + 117*r^2 + 162*r + 81)